<?php namespace App\Domain\Item\Service;


use App\Domain\Item\Model\Item;

class ItemServiceImpl implements ItemService
{
    public function getItemById($id){
        return Item::where('SerialNo',$id)
        ->leftjoin('circ_marc as info','Items.MarcID','=', 'info.MarcID')
        ->select('info.Title as title','info.Profile as profile','info.ImageUrl as imageUrl', 'info.Price as price','Items.*')
        ->first();
    }

    public function updateLTStatuesByBookId($bookid){
        return Item::where('SerialNo',$bookid)
            ->update([
                'LTStatus' => Item::STATUS_4
            ]);

    }


    public function getItemByBarCode($barcode){
        return Item::where('BarCode',$barcode)
            ->first();
    }


}